﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<body>
<div id="CountMsg">距今天下午6点还有：<strong id="RemainH">XX</strong>时<strong id="RemainM">XX</strong>分<strong id="RemainS">XX</strong>秒</div> 
<script type="text/javascript">
function createXMLHttpRequest () {
     var request = false;
     if(window.XMLHttpRequest) {
         request = new XMLHttpRequest();
         if(request.overrideMimeType) {
             request.overrideMimeType('text/xml');
         }
     } else if(window.ActiveXObject) {
         var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
         for(var i=0; i<versions.length; i++) {
             try {
                 request = new ActiveXObject(versions[i]);
                 if(request) {
                     return request;
                 }
             } catch(e) {
                 //alert(e.message);
             }
         }
     }
     return request;
}
var http = createXMLHttpRequest();
http.open("HEAD", ".", false);
var now = new Date();
http.send(null);
var curDate = Date.parse(http.getResponseHeader("Date"));// 当前时间
var offsetTime = now.getTime() - (new Date()).getTime(); 
var endTime= new Date(2010,6,19,18,0); //截止时间:
var sec = 1000, min = 60 * sec, hour = 60 * min, day = 24 * hour;
var countMS = endTime.getTime() - curDate - offsetTime ;

setInterval(function(){
    
    var nD =Math.floor(countMS/day);
    var nH=Math.floor(countMS/hour) % 24;
    var nM=Math.floor(countMS/min) % 60;
    var nS=Math.floor(countMS/sec) % 60;
    if(nD>= 0){
        document.getElementById("RemainH").innerHTML=nH;
        document.getElementById("RemainM").innerHTML=nM;
        document.getElementById("RemainS").innerHTML=nS;
    }
    else {
     
    }
    countMS = countMS - 1000;
}, 1000);
</script> 
</html> 
<!--Urchin 6 Start--> 
<script src="http://traffic.house.sina.com.cn/urchin.js" type="text/javascript"> 
</script> 
<script type="text/javascript"> 
_userv=0;
urchinTracker();
</script> 
<!--Urchin 6 End--> 